name conventions
Symbols represent many kinds of language elements, yet each kind is always visually
distinguishable. Arrays always have square brackets, functions always have
parentheses, etc. Programs are easy to read because you can always tell what the
elements of the program are.
Consistent naming conventions also promote program readability. The following naming conventions are generally observed, hopefully by your programs too.
keywords
All characters of keywords are upper case.
Examples: IF DO FOR GOSUB
FUNCTION DOUBLE STRING
type names
Built-in data type names are upper case.
Examples: SBYTE USHORT STRING DOUBLE
DCOMPLEX
user defined aka composite type names
User-defined data type names are upper case in most instances.
Examples: COLOR WINDOW LENS SURFACE
GLASS XWindowAttributes
variable names
The first character is lower case and the 1st character of each imbedded word is upper
case.
Examples: value value$ thisValue thoseValues[]
GOTO label names
The first character is lower case and the first character of imbedded words are upper
case.
Examples: label goHere goEveryWhichWay
subroutine names
The first character is upper case and the 1st character of each imbedded word is upper
case.
Examples: Create CreateWindow CreateTrouble
NukeWashingtonDC
function names
The first character is upper case and the first character of each imbedded word is upper
case.
Examples: FuncName() Rotate() SingeTheUniverse()
reserved names
Function and sharename symbols that begin with three consecutive x characters (Xxx, xxx,
XXX, etc) are reserved symbols. Do not create, call, or reference any such variables
or functions. Also don't create functions with prefixes that conflict with known
function libraries, like Xst, Xma, Xcm, Xgr, Xui, etc.